//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { Crontab, CrontabResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooCrontabList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<CrontabResponse>(`/uctoo/crontab/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooCrontab = async (id: string) => {
  return requestClient.get<Crontab>(`/uctoo/crontab/${id}`);
};

export const adductooCrontab = async (data: Partial<Crontab>) => {
  return requestClient.post<Crontab>('/uctoo/crontab/add', data);
};

export const edituctooCrontab = async (data: Partial<Crontab>) => {
  return requestClient.post<Crontab>('/uctoo/crontab/edit', data);
};

export const deleteuctooCrontab = async (id: string) => {
  return requestClient.post<any>('/uctoo/crontab/del', { id });
};
